{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!--BOOK_INFORMATION-->\n",
    "<a href=\"https://user-images.githubusercontent.com/19553554/71825144-2d568180-30d6-11ea-8ee0-63c849cfd934.png\" target=\"_blank\"><img align=\"left\" style=\"width: 76px; height: 100px; background: white; padding: 1px; border: 1px solid black; margin-right:10px;\"></a>\n",
    "*pyecharts 是一个用于生成 Echarts 图表的类库。Echarts 是百度开源的一个数据可视化 JS 库。用 Echarts 生成的图可视化效果非常棒，为了与 Python 进行对接，方便在 Python 中直接使用数据生成图，于是有人开发出了这个项目[GitHub](https://github.com/pyecharts/pyecharts) .*\n",
    "\n",
    "*Note.建议本程序在参看https://github.com/pyecharts/pyecharts 的安装步骤后再运行； 本程序所有的例子都是从官方提供的样例代码[GitHub](https://github.com/pyecharts/pyecharts-gallery)中提取的,如果对某个API有疑问建议在IDE里面查看*\n",
    "\n",
    "*Echart类型图种大全:https://echarts.apache.org/examples/zh/#chart-type-line pyecharts图导入到ppt中的方法:https://baijiahao.baidu.com/s?id=1663839456876951842&wfr=spider&for=pc.*\n",
    "\n",
    "*作者: LBQ; 时间:2020/7/24. 邮箱:779660843@qq.com*"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/fisadm/anaconda3/envs/detectron2/lib/python3.7/site-packages/pyecharts/charts/chart.py:14: PendingDeprecationWarning: pyecharts 所有图表类型将在 v1.9.0 版本开始强制使用 ChartItem 进行数据项配置 :)\n",
      "  super().__init__(init_opts=init_opts)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'china':'https://assets.pyecharts.org/assets/maps/china'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"4a272d9a67b241748b8e90f2a7e93357\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'china'], function(echarts) {\n",
       "                var chart_4a272d9a67b241748b8e90f2a7e93357 = echarts.init(\n",
       "                    document.getElementById('4a272d9a67b241748b8e90f2a7e93357'), 'white', {renderer: 'canvas'});\n",
       "                var option_4a272d9a67b241748b8e90f2a7e93357 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"scatter\",\n",
       "            \"name\": \"geo\",\n",
       "            \"coordinateSystem\": \"geo\",\n",
       "            \"symbolSize\": 12,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u4e1c\",\n",
       "                    \"value\": [\n",
       "                        113.26653,\n",
       "                        23.132191,\n",
       "                        141\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5317\\u4eac\",\n",
       "                    \"value\": [\n",
       "                        116.407526,\n",
       "                        39.90403,\n",
       "                        123\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e0a\\u6d77\",\n",
       "                    \"value\": [\n",
       "                        121.473701,\n",
       "                        31.230416,\n",
       "                        61\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u897f\",\n",
       "                    \"value\": [\n",
       "                        115.909228,\n",
       "                        28.675696,\n",
       "                        101\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6e56\\u5357\",\n",
       "                    \"value\": [\n",
       "                        112.98381,\n",
       "                        28.112444,\n",
       "                        78\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d59\\u6c5f\",\n",
       "                    \"value\": [\n",
       "                        120.152791,\n",
       "                        30.267446,\n",
       "                        101\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u82cf\",\n",
       "                    \"value\": [\n",
       "                        118.763232,\n",
       "                        32.061707,\n",
       "                        144\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"geo\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"geo\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"formatter\": function (params) {        return params.name + ' : ' + params.value[2];    },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Geo-\\u57fa\\u672c\\u793a\\u4f8b\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"visualMap\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"continuous\",\n",
       "        \"min\": 0,\n",
       "        \"max\": 100,\n",
       "        \"inRange\": {\n",
       "            \"color\": [\n",
       "                \"#50a3ba\",\n",
       "                \"#eac763\",\n",
       "                \"#d94e5d\"\n",
       "            ]\n",
       "        },\n",
       "        \"calculable\": true,\n",
       "        \"inverse\": false,\n",
       "        \"splitNumber\": 5,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"showLabel\": true,\n",
       "        \"itemWidth\": 20,\n",
       "        \"itemHeight\": 140,\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"geo\": {\n",
       "        \"map\": \"china\",\n",
       "        \"roam\": true,\n",
       "        \"emphasis\": {}\n",
       "    }\n",
       "};\n",
       "                chart_4a272d9a67b241748b8e90f2a7e93357.setOption(option_4a272d9a67b241748b8e90f2a7e93357);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x7f67fc60e5f8>"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Geo\n",
    "from pyecharts.faker import Faker\n",
    "\n",
    "c = (\n",
    "    Geo()\n",
    "    .add_schema(maptype=\"china\")\n",
    "    .add(\"geo\", [list(z) for z in zip(Faker.provinces, Faker.values())])\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(is_show=False))\n",
    "    .set_global_opts(\n",
    "        visualmap_opts=opts.VisualMapOpts(), title_opts=opts.TitleOpts(title=\"Geo-基本示例\")\n",
    "    )\n",
    "    #.render(\"geo_base.html\")\n",
    ")\n",
    "c.load_javascript()\n",
    "c.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/fisadm/anaconda3/envs/detectron2/lib/python3.7/site-packages/pyecharts/charts/chart.py:14: PendingDeprecationWarning: pyecharts 所有图表类型将在 v1.9.0 版本开始强制使用 ChartItem 进行数据项配置 :)\n",
      "  super().__init__(init_opts=init_opts)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', '瑞士':'https://assets.pyecharts.org/assets/maps/Switzerland'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"2943e0bfd4194cec8c42349ac53d5dc1\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', '瑞士'], function(echarts) {\n",
       "                var chart_2943e0bfd4194cec8c42349ac53d5dc1 = echarts.init(\n",
       "                    document.getElementById('2943e0bfd4194cec8c42349ac53d5dc1'), 'white', {renderer: 'canvas'});\n",
       "                var option_2943e0bfd4194cec8c42349ac53d5dc1 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [],\n",
       "            \"selected\": {},\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"formatter\": function (params) {        return params.name + ' : ' + params.value[2];    },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u745e\\u58eb\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"geo\": {\n",
       "        \"map\": \"\\u745e\\u58eb\",\n",
       "        \"roam\": true,\n",
       "        \"emphasis\": {}\n",
       "    }\n",
       "};\n",
       "                chart_2943e0bfd4194cec8c42349ac53d5dc1.setOption(option_2943e0bfd4194cec8c42349ac53d5dc1);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x7f67fc1cb160>"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts.datasets import register_url\n",
    "\n",
    "# try:\n",
    "#     register_url(\"https://echarts-maps.github.io/echarts-countries-js/\")\n",
    "# except Exception:\n",
    "#     import ssl\n",
    "\n",
    "#     ssl._create_default_https_context = ssl._create_unverified_context\n",
    "#     register_url(\"https://echarts-maps.github.io/echarts-countries-js/\")\n",
    "\n",
    "geo = (\n",
    "    Geo()\n",
    "    .add_schema(maptype=\"瑞士\")\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title=\"瑞士\"))\n",
    "    #.render(\"geo_chart_countries_js.html\")\n",
    ")\n",
    "geo.load_javascript()\n",
    "geo.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/fisadm/anaconda3/envs/detectron2/lib/python3.7/site-packages/pyecharts/charts/chart.py:14: PendingDeprecationWarning: pyecharts 所有图表类型将在 v1.9.0 版本开始强制使用 ChartItem 进行数据项配置 :)\n",
      "  super().__init__(init_opts=init_opts)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', '海南':'https://assets.pyecharts.org/assets/maps/hainan'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"eac6c7bde85d492caeb761e24d69cfdb\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', '海南'], function(echarts) {\n",
       "                var chart_eac6c7bde85d492caeb761e24d69cfdb = echarts.init(\n",
       "                    document.getElementById('eac6c7bde85d492caeb761e24d69cfdb'), 'white', {renderer: 'canvas'});\n",
       "                var option_eac6c7bde85d492caeb761e24d69cfdb = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [],\n",
       "            \"selected\": {},\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"formatter\": function (params) {        return params.name + ' : ' + params.value[2];    },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u6d77\\u6dc0\\u533a\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"geo\": {\n",
       "        \"map\": \"\\u6d77\\u5357\",\n",
       "        \"roam\": true,\n",
       "        \"emphasis\": {}\n",
       "    }\n",
       "};\n",
       "                chart_eac6c7bde85d492caeb761e24d69cfdb.setOption(option_eac6c7bde85d492caeb761e24d69cfdb);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x7f67fc1cbfd0>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# try:\n",
    "#     register_url(\"https://echarts-maps.github.io/echarts-china-counties-js/\")\n",
    "# except Exception:\n",
    "#     import ssl\n",
    "\n",
    "#     ssl._create_default_https_context = ssl._create_unverified_context\n",
    "#     register_url(\"https://echarts-maps.github.io/echarts-china-counties-js/\")\n",
    "\n",
    "hdq = (\n",
    "    Geo()\n",
    "    .add_schema(maptype=\"海南\")\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title=\"海南岛\"))\n",
    "    #.render(\"geo_echart_china_js.html\")\n",
    ")\n",
    "hdq.load_javascript()\n",
    "hdq.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/fisadm/anaconda3/envs/detectron2/lib/python3.7/site-packages/pyecharts/charts/chart.py:14: PendingDeprecationWarning: pyecharts 所有图表类型将在 v1.9.0 版本开始强制使用 ChartItem 进行数据项配置 :)\n",
      "  super().__init__(init_opts=init_opts)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'china':'https://assets.pyecharts.org/assets/maps/china'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"f3ce77ee2ee84fce90570bea4751b8c1\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'china'], function(echarts) {\n",
       "                var chart_f3ce77ee2ee84fce90570bea4751b8c1 = echarts.init(\n",
       "                    document.getElementById('f3ce77ee2ee84fce90570bea4751b8c1'), 'white', {renderer: 'canvas'});\n",
       "                var option_f3ce77ee2ee84fce90570bea4751b8c1 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"effectScatter\",\n",
       "            \"name\": \"geo\",\n",
       "            \"coordinateSystem\": \"geo\",\n",
       "            \"showEffectOn\": \"render\",\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            },\n",
       "            \"symbolSize\": 12,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u4e1c\",\n",
       "                    \"value\": [\n",
       "                        113.26653,\n",
       "                        23.132191,\n",
       "                        90\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5317\\u4eac\",\n",
       "                    \"value\": [\n",
       "                        116.407526,\n",
       "                        39.90403,\n",
       "                        87\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e0a\\u6d77\",\n",
       "                    \"value\": [\n",
       "                        121.473701,\n",
       "                        31.230416,\n",
       "                        44\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u897f\",\n",
       "                    \"value\": [\n",
       "                        115.909228,\n",
       "                        28.675696,\n",
       "                        38\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6e56\\u5357\",\n",
       "                    \"value\": [\n",
       "                        112.98381,\n",
       "                        28.112444,\n",
       "                        136\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d59\\u6c5f\",\n",
       "                    \"value\": [\n",
       "                        120.152791,\n",
       "                        30.267446,\n",
       "                        142\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u82cf\",\n",
       "                    \"value\": [\n",
       "                        118.763232,\n",
       "                        32.061707,\n",
       "                        97\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"geo\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"geo\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"formatter\": function (params) {        return params.name + ' : ' + params.value[2];    },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Geo-EffectScatter\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"geo\": {\n",
       "        \"map\": \"china\",\n",
       "        \"roam\": true,\n",
       "        \"emphasis\": {}\n",
       "    }\n",
       "};\n",
       "                chart_f3ce77ee2ee84fce90570bea4751b8c1.setOption(option_f3ce77ee2ee84fce90570bea4751b8c1);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x7f67fc157a58>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts.globals import ChartType\n",
    "\n",
    "sdt = (\n",
    "    Geo()\n",
    "    .add_schema(maptype=\"china\")\n",
    "    .add(\n",
    "        \"geo\",\n",
    "        [list(z) for z in zip(Faker.provinces, Faker.values())],\n",
    "        type_=ChartType.EFFECT_SCATTER,\n",
    "    )\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(is_show=False))\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title=\"Geo-EffectScatter\"))\n",
    "    #.render(\"geo_effectscatter.html\")\n",
    ")\n",
    "sdt.load_javascript()\n",
    "sdt.render_notebook()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/fisadm/anaconda3/envs/detectron2/lib/python3.7/site-packages/pyecharts/charts/chart.py:14: PendingDeprecationWarning: pyecharts 所有图表类型将在 v1.9.0 版本开始强制使用 ChartItem 进行数据项配置 :)\n",
      "  super().__init__(init_opts=init_opts)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', '广东':'https://assets.pyecharts.org/assets/maps/guangdong'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"5887b89c3da440cbbdcbba99fc146c23\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', '广东'], function(echarts) {\n",
       "                var chart_5887b89c3da440cbbdcbba99fc146c23 = echarts.init(\n",
       "                    document.getElementById('5887b89c3da440cbbdcbba99fc146c23'), 'white', {renderer: 'canvas'});\n",
       "                var option_5887b89c3da440cbbdcbba99fc146c23 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"heatmap\",\n",
       "            \"name\": \"geo\",\n",
       "            \"coordinateSystem\": \"geo\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u6c55\\u5934\\u5e02\",\n",
       "                    \"value\": [\n",
       "                        116.68,\n",
       "                        23.35,\n",
       "                        31\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c55\\u5c3e\\u5e02\",\n",
       "                    \"value\": [\n",
       "                        115.37,\n",
       "                        22.78,\n",
       "                        81\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u63ed\\u9633\\u5e02\",\n",
       "                    \"value\": [\n",
       "                        116.37,\n",
       "                        23.55,\n",
       "                        87\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u9633\\u6c5f\\u5e02\",\n",
       "                    \"value\": [\n",
       "                        111.98,\n",
       "                        21.87,\n",
       "                        43\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u8087\\u5e86\\u5e02\",\n",
       "                    \"value\": [\n",
       "                        112.47,\n",
       "                        23.05,\n",
       "                        95\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u5dde\\u5e02\",\n",
       "                    \"value\": [\n",
       "                        113.27,\n",
       "                        23.13,\n",
       "                        54\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u60e0\\u5dde\\u5e02\",\n",
       "                    \"value\": [\n",
       "                        114.42,\n",
       "                        23.12,\n",
       "                        33\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"pointSize\": 20,\n",
       "            \"blurSize\": 20,\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"geo\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"geo\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"formatter\": function (params) {        return params.name + ' : ' + params.value[2];    },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Geo-\\u5e7f\\u4e1c\\u5730\\u56fe\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"visualMap\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"continuous\",\n",
       "        \"min\": 0,\n",
       "        \"max\": 100,\n",
       "        \"inRange\": {\n",
       "            \"color\": [\n",
       "                \"#50a3ba\",\n",
       "                \"#eac763\",\n",
       "                \"#d94e5d\"\n",
       "            ]\n",
       "        },\n",
       "        \"calculable\": true,\n",
       "        \"inverse\": false,\n",
       "        \"splitNumber\": 5,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"showLabel\": true,\n",
       "        \"itemWidth\": 20,\n",
       "        \"itemHeight\": 140,\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"geo\": {\n",
       "        \"map\": \"\\u5e7f\\u4e1c\",\n",
       "        \"roam\": true,\n",
       "        \"emphasis\": {}\n",
       "    }\n",
       "};\n",
       "                chart_5887b89c3da440cbbdcbba99fc146c23.setOption(option_5887b89c3da440cbbdcbba99fc146c23);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x7f67fc1cb748>"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "gd = (\n",
    "    Geo()\n",
    "    .add_schema(maptype=\"广东\")\n",
    "    .add(\n",
    "        \"geo\",\n",
    "        [list(z) for z in zip(Faker.guangdong_city, Faker.values())],\n",
    "        type_=ChartType.HEATMAP,\n",
    "    )\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(is_show=False))\n",
    "    .set_global_opts(\n",
    "        visualmap_opts=opts.VisualMapOpts(), title_opts=opts.TitleOpts(title=\"Geo-广东地图\")\n",
    "    )\n",
    "    #.render(\"geo_guangdong.html\")\n",
    ")\n",
    "gd.load_javascript()\n",
    "gd.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/fisadm/anaconda3/envs/detectron2/lib/python3.7/site-packages/pyecharts/charts/chart.py:14: PendingDeprecationWarning: pyecharts 所有图表类型将在 v1.9.0 版本开始强制使用 ChartItem 进行数据项配置 :)\n",
      "  super().__init__(init_opts=init_opts)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'china':'https://assets.pyecharts.org/assets/maps/china'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"03b94ed1c173460092604965646a02bd\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'china'], function(echarts) {\n",
       "                var chart_03b94ed1c173460092604965646a02bd = echarts.init(\n",
       "                    document.getElementById('03b94ed1c173460092604965646a02bd'), 'white', {renderer: 'canvas'});\n",
       "                var option_03b94ed1c173460092604965646a02bd = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"heatmap\",\n",
       "            \"name\": \"geo\",\n",
       "            \"coordinateSystem\": \"geo\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u4e1c\",\n",
       "                    \"value\": [\n",
       "                        113.26653,\n",
       "                        23.132191,\n",
       "                        66\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5317\\u4eac\",\n",
       "                    \"value\": [\n",
       "                        116.407526,\n",
       "                        39.90403,\n",
       "                        88\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e0a\\u6d77\",\n",
       "                    \"value\": [\n",
       "                        121.473701,\n",
       "                        31.230416,\n",
       "                        104\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u897f\",\n",
       "                    \"value\": [\n",
       "                        115.909228,\n",
       "                        28.675696,\n",
       "                        81\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6e56\\u5357\",\n",
       "                    \"value\": [\n",
       "                        112.98381,\n",
       "                        28.112444,\n",
       "                        148\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d59\\u6c5f\",\n",
       "                    \"value\": [\n",
       "                        120.152791,\n",
       "                        30.267446,\n",
       "                        28\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u82cf\",\n",
       "                    \"value\": [\n",
       "                        118.763232,\n",
       "                        32.061707,\n",
       "                        132\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"pointSize\": 20,\n",
       "            \"blurSize\": 20,\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"geo\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"geo\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"formatter\": function (params) {        return params.name + ' : ' + params.value[2];    },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Geo-HeatMap\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"visualMap\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"continuous\",\n",
       "        \"min\": 0,\n",
       "        \"max\": 100,\n",
       "        \"inRange\": {\n",
       "            \"color\": [\n",
       "                \"#50a3ba\",\n",
       "                \"#eac763\",\n",
       "                \"#d94e5d\"\n",
       "            ]\n",
       "        },\n",
       "        \"calculable\": true,\n",
       "        \"inverse\": false,\n",
       "        \"splitNumber\": 5,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"showLabel\": true,\n",
       "        \"itemWidth\": 20,\n",
       "        \"itemHeight\": 140,\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"geo\": {\n",
       "        \"map\": \"china\",\n",
       "        \"roam\": true,\n",
       "        \"emphasis\": {}\n",
       "    }\n",
       "};\n",
       "                chart_03b94ed1c173460092604965646a02bd.setOption(option_03b94ed1c173460092604965646a02bd);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x7f67fc6adfd0>"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "hm = (\n",
    "    Geo()\n",
    "    .add_schema(maptype=\"china\")\n",
    "    .add(\n",
    "        \"geo\",\n",
    "        [list(z) for z in zip(Faker.provinces, Faker.values())],\n",
    "        type_=ChartType.HEATMAP,\n",
    "    )\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(is_show=False))\n",
    "    .set_global_opts(\n",
    "        visualmap_opts=opts.VisualMapOpts(),\n",
    "        title_opts=opts.TitleOpts(title=\"Geo-HeatMap\"),\n",
    "    )\n",
    "    #.render(\"geo_heatmap.html\")\n",
    ")\n",
    "hm.load_javascript()\n",
    "hm.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/fisadm/anaconda3/envs/detectron2/lib/python3.7/site-packages/pyecharts/charts/chart.py:14: PendingDeprecationWarning: pyecharts 所有图表类型将在 v1.9.0 版本开始强制使用 ChartItem 进行数据项配置 :)\n",
      "  super().__init__(init_opts=init_opts)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'china':'https://assets.pyecharts.org/assets/maps/china'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"22c004614e85466cb27f07a5f1b778a0\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'china'], function(echarts) {\n",
       "                var chart_22c004614e85466cb27f07a5f1b778a0 = echarts.init(\n",
       "                    document.getElementById('22c004614e85466cb27f07a5f1b778a0'), 'white', {renderer: 'canvas'});\n",
       "                var option_22c004614e85466cb27f07a5f1b778a0 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"white\",\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"effectScatter\",\n",
       "            \"coordinateSystem\": \"geo\",\n",
       "            \"showEffectOn\": \"render\",\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            },\n",
       "            \"symbolSize\": 12,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u5dde\",\n",
       "                    \"value\": [\n",
       "                        113.23,\n",
       "                        23.16,\n",
       "                        55\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5317\\u4eac\",\n",
       "                    \"value\": [\n",
       "                        116.407526,\n",
       "                        39.90403,\n",
       "                        66\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u676d\\u5dde\",\n",
       "                    \"value\": [\n",
       "                        120.19,\n",
       "                        30.26,\n",
       "                        77\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u91cd\\u5e86\",\n",
       "                    \"value\": [\n",
       "                        106.551556,\n",
       "                        29.563009,\n",
       "                        88\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"scatter\",\n",
       "            \"name\": \"geo\",\n",
       "            \"coordinateSystem\": \"geo\",\n",
       "            \"symbolSize\": 12,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u5dde\",\n",
       "                    \"value\": [\n",
       "                        113.23,\n",
       "                        23.16,\n",
       "                        \"\\u4e0a\\u6d77\"\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u5dde\",\n",
       "                    \"value\": [\n",
       "                        113.23,\n",
       "                        23.16,\n",
       "                        \"\\u5317\\u4eac\"\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u5dde\",\n",
       "                    \"value\": [\n",
       "                        113.23,\n",
       "                        23.16,\n",
       "                        \"\\u676d\\u5dde\"\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u5dde\",\n",
       "                    \"value\": [\n",
       "                        113.23,\n",
       "                        23.16,\n",
       "                        \"\\u91cd\\u5e86\"\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\",\n",
       "                \"geo\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\": true,\n",
       "                \"geo\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"formatter\": function (params) {        return params.name + ' : ' + params.value[2];    },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Geo-Lines\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"geo\": {\n",
       "        \"map\": \"china\",\n",
       "        \"roam\": true,\n",
       "        \"emphasis\": {}\n",
       "    }\n",
       "};\n",
       "                chart_22c004614e85466cb27f07a5f1b778a0.setOption(option_22c004614e85466cb27f07a5f1b778a0);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x7f67fc60ea90>"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts.globals import SymbolType\n",
    "l = (\n",
    "    Geo()\n",
    "    .add_schema(maptype=\"china\")\n",
    "    .add(\n",
    "        \"\",\n",
    "        [(\"广州\", 55), (\"北京\", 66), (\"杭州\", 77), (\"重庆\", 88)],\n",
    "        type_=ChartType.EFFECT_SCATTER,\n",
    "        color=\"white\",\n",
    "    )\n",
    "    .add(\n",
    "        \"geo\",\n",
    "        [(\"广州\", \"上海\"), (\"广州\", \"北京\"), (\"广州\", \"杭州\"), (\"广州\", \"重庆\")],\n",
    "        type_=ChartType.LINES,#添加指示线\n",
    "        effect_opts=opts.EffectOpts(\n",
    "            symbol=SymbolType.ARROW, symbol_size=6, color=\"blue\"\n",
    "        ),\n",
    "        linestyle_opts=opts.LineStyleOpts(curve=0.2),\n",
    "    )\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(is_show=False))\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title=\"Geo-Lines\"))\n",
    "    #.render(\"geo_lines.html\")\n",
    ")\n",
    "l.load_javascript()\n",
    "l.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/fisadm/anaconda3/envs/detectron2/lib/python3.7/site-packages/pyecharts/charts/chart.py:14: PendingDeprecationWarning: pyecharts 所有图表类型将在 v1.9.0 版本开始强制使用 ChartItem 进行数据项配置 :)\n",
      "  super().__init__(init_opts=init_opts)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'china':'https://assets.pyecharts.org/assets/maps/china'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"70c6daeafc034443b0081cd859590d47\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'china'], function(echarts) {\n",
       "                var chart_70c6daeafc034443b0081cd859590d47 = echarts.init(\n",
       "                    document.getElementById('70c6daeafc034443b0081cd859590d47'), 'white', {renderer: 'canvas'});\n",
       "                var option_70c6daeafc034443b0081cd859590d47 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"white\",\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"effectScatter\",\n",
       "            \"coordinateSystem\": \"geo\",\n",
       "            \"showEffectOn\": \"render\",\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            },\n",
       "            \"symbolSize\": 12,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u5dde\",\n",
       "                    \"value\": [\n",
       "                        113.23,\n",
       "                        23.16,\n",
       "                        55\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5317\\u4eac\",\n",
       "                    \"value\": [\n",
       "                        116.407526,\n",
       "                        39.90403,\n",
       "                        66\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u676d\\u5dde\",\n",
       "                    \"value\": [\n",
       "                        120.19,\n",
       "                        30.26,\n",
       "                        77\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u91cd\\u5e86\",\n",
       "                    \"value\": [\n",
       "                        106.551556,\n",
       "                        29.563009,\n",
       "                        88\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"lines\",\n",
       "            \"name\": \"geo\",\n",
       "            \"coordinateSystem\": \"geo\",\n",
       "            \"zlevel\": 3,\n",
       "            \"progressive\": 400,\n",
       "            \"progressiveThreshold\": 3000,\n",
       "            \"effect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4,\n",
       "                \"color\": \"blue\",\n",
       "                \"symbol\": \"arrow\",\n",
       "                \"symbolSize\": 6\n",
       "            },\n",
       "            \"symbol\": [\n",
       "                \"none\",\n",
       "                \"arrow\"\n",
       "            ],\n",
       "            \"polyline\": false,\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 2000,\n",
       "            \"symbolSize\": 12,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u5dde->\\u4e0a\\u6d77\",\n",
       "                    \"coords\": [\n",
       "                        [\n",
       "                            113.23,\n",
       "                            23.16\n",
       "                        ],\n",
       "                        [\n",
       "                            121.473701,\n",
       "                            31.230416\n",
       "                        ]\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u5dde->\\u5317\\u4eac\",\n",
       "                    \"coords\": [\n",
       "                        [\n",
       "                            113.23,\n",
       "                            23.16\n",
       "                        ],\n",
       "                        [\n",
       "                            116.407526,\n",
       "                            39.90403\n",
       "                        ]\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u5dde->\\u676d\\u5dde\",\n",
       "                    \"coords\": [\n",
       "                        [\n",
       "                            113.23,\n",
       "                            23.16\n",
       "                        ],\n",
       "                        [\n",
       "                            120.19,\n",
       "                            30.26\n",
       "                        ]\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u5dde->\\u91cd\\u5e86\",\n",
       "                    \"coords\": [\n",
       "                        [\n",
       "                            113.23,\n",
       "                            23.16\n",
       "                        ],\n",
       "                        [\n",
       "                            106.551556,\n",
       "                            29.563009\n",
       "                        ]\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"lineStyle\": {\n",
       "                \"show\": true,\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0.2,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\",\n",
       "                \"geo\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\": true,\n",
       "                \"geo\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"formatter\": function (params) {        return params.name + ' : ' + params.value[2];    },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Geo-Lines-background\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"geo\": {\n",
       "        \"map\": \"china\",\n",
       "        \"roam\": true,\n",
       "        \"itemStyle\": {\n",
       "            \"color\": \"#323c48\",\n",
       "            \"borderColor\": \"#111\"\n",
       "        },\n",
       "        \"emphasis\": {}\n",
       "    }\n",
       "};\n",
       "                chart_70c6daeafc034443b0081cd859590d47.setOption(option_70c6daeafc034443b0081cd859590d47);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x7f67fc169550>"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bg = (\n",
    "    Geo()\n",
    "    .add_schema(\n",
    "        maptype=\"china\",\n",
    "        itemstyle_opts=opts.ItemStyleOpts(color=\"#323c48\", border_color=\"#111\"),\n",
    "    )\n",
    "    .add(\n",
    "        \"\",\n",
    "        [(\"广州\", 55), (\"北京\", 66), (\"杭州\", 77), (\"重庆\", 88)],\n",
    "        type_=ChartType.EFFECT_SCATTER,\n",
    "        color=\"white\",\n",
    "    )\n",
    "    .add(\n",
    "        \"geo\",\n",
    "        [(\"广州\", \"上海\"), (\"广州\", \"北京\"), (\"广州\", \"杭州\"), (\"广州\", \"重庆\")],\n",
    "        type_=ChartType.LINES,\n",
    "        effect_opts=opts.EffectOpts(\n",
    "            symbol=SymbolType.ARROW, symbol_size=6, color=\"blue\"\n",
    "        ),\n",
    "        linestyle_opts=opts.LineStyleOpts(curve=0.2),\n",
    "    )\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(is_show=False))\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title=\"Geo-Lines-background\"))\n",
    "    #.render(\"geo_lines_background.html\")\n",
    ")\n",
    "bg.load_javascript()\n",
    "bg.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/fisadm/anaconda3/envs/detectron2/lib/python3.7/site-packages/pyecharts/charts/chart.py:14: PendingDeprecationWarning: pyecharts 所有图表类型将在 v1.9.0 版本开始强制使用 ChartItem 进行数据项配置 :)\n",
      "  super().__init__(init_opts=init_opts)\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'china':'https://assets.pyecharts.org/assets/maps/china'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"c795f9aeb2b24389806e75669b168dd1\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'china'], function(echarts) {\n",
       "                var chart_c795f9aeb2b24389806e75669b168dd1 = echarts.init(\n",
       "                    document.getElementById('c795f9aeb2b24389806e75669b168dd1'), 'white', {renderer: 'canvas'});\n",
       "                var option_c795f9aeb2b24389806e75669b168dd1 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"scatter\",\n",
       "            \"name\": \"geo\",\n",
       "            \"coordinateSystem\": \"geo\",\n",
       "            \"symbolSize\": 12,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u4e1c\",\n",
       "                    \"value\": [\n",
       "                        113.26653,\n",
       "                        23.132191,\n",
       "                        97\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5317\\u4eac\",\n",
       "                    \"value\": [\n",
       "                        116.407526,\n",
       "                        39.90403,\n",
       "                        103\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e0a\\u6d77\",\n",
       "                    \"value\": [\n",
       "                        121.473701,\n",
       "                        31.230416,\n",
       "                        147\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u897f\",\n",
       "                    \"value\": [\n",
       "                        115.909228,\n",
       "                        28.675696,\n",
       "                        66\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6e56\\u5357\",\n",
       "                    \"value\": [\n",
       "                        112.98381,\n",
       "                        28.112444,\n",
       "                        36\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d59\\u6c5f\",\n",
       "                    \"value\": [\n",
       "                        120.152791,\n",
       "                        30.267446,\n",
       "                        75\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u82cf\",\n",
       "                    \"value\": [\n",
       "                        118.763232,\n",
       "                        32.061707,\n",
       "                        141\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"geo\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"geo\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"formatter\": function (params) {        return params.name + ' : ' + params.value[2];    },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Geo-VisualMap\\uff08\\u5206\\u6bb5\\u578b\\uff09\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"visualMap\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"piecewise\",\n",
       "        \"min\": 0,\n",
       "        \"max\": 100,\n",
       "        \"inRange\": {\n",
       "            \"color\": [\n",
       "                \"#50a3ba\",\n",
       "                \"#eac763\",\n",
       "                \"#d94e5d\"\n",
       "            ]\n",
       "        },\n",
       "        \"calculable\": true,\n",
       "        \"inverse\": false,\n",
       "        \"splitNumber\": 5,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"showLabel\": true,\n",
       "        \"itemWidth\": 20,\n",
       "        \"itemHeight\": 14,\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"geo\": {\n",
       "        \"map\": \"china\",\n",
       "        \"roam\": true,\n",
       "        \"emphasis\": {}\n",
       "    }\n",
       "};\n",
       "                chart_c795f9aeb2b24389806e75669b168dd1.setOption(option_c795f9aeb2b24389806e75669b168dd1);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x7f67fc163898>"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "vm = (\n",
    "    Geo()\n",
    "    .add_schema(maptype=\"china\")\n",
    "    .add(\"geo\", [list(z) for z in zip(Faker.provinces, Faker.values())])\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(is_show=False))\n",
    "    .set_global_opts(\n",
    "        visualmap_opts=opts.VisualMapOpts(is_piecewise=True),\n",
    "        title_opts=opts.TitleOpts(title=\"Geo-VisualMap（分段型）\"),\n",
    "    )\n",
    "    #.render(\"geo_visualmap_piecewise.html\")\n",
    ")\n",
    "vm.load_javascript()\n",
    "vm.render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
